import { defineConfig } from 'vite';
import { resolve } from 'path';

/* Vite配置 */
import ViteConfig from './vite-setting/index';

export default defineConfig({
	/* 公共基础路径 */
	base: process.env.NODE_ENV === 'production' ? '/' : './',

	/* 路径别名 */
	resolve: ViteConfig.CreateViteResolve((dir: any) => resolve(__dirname, dir)),

	/* css配置 */
	css: ViteConfig.CssConfig(),

	/* 插件配置 */
	plugins: ViteConfig.CreateVitePlugins(resolve),

	/* 服务配置 */
	server: ViteConfig.ProxyConfig(),

	/* build配置 */
	build: ViteConfig.BuildConfig(),

	optimizeDeps: {
		include: ['vue', 'vue-router', 'pinia', 'axios'],
		exclude: []
	}
});
